package com.flyduck.vueshop.product.feign;

import com.flyduck.vueshop.common.core.lang.Result;
import com.flyduck.vueshop.product.fallback.RemoteSkuStockFallback;
import com.flyduck.vueshop.product.vo.RemoteSkuStockReduceReqVO;
import com.flyduck.vueshop.product.vo.RemoteSkuStockReleaseReqVO;
import com.flyduck.vueshop.product.vo.RemoteSkuStockRespVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <p>
 * RemoteSkuStockFeignClient
 * </p>
 *
 * @author flyduck
 * @since 2024-07-15
 */
@FeignClient(name = "vueshop-service-product",contextId = "remoteSkuStockFeignClient",fallback = RemoteSkuStockFallback.class)
public interface RemoteSkuStockFeignClient {

    @PostMapping("/product/remote/skuStock/batchReduceSkuStock")
    Result<Void> batchReduceSkuStock(@RequestBody List<RemoteSkuStockReduceReqVO> remoteSkuStockReduceReqVOList);

    @PostMapping("/product/remote/skuStock/batchReleaseSkuStock")
    Result<Void> batchReleaseSkuStock(@RequestBody List<RemoteSkuStockReleaseReqVO> remoteSkuStockReleaseReqVOList);

    @GetMapping("/product/remote/skuStock/getSkuStock")
    Result<RemoteSkuStockRespVO> getSkuStock(@RequestParam("productId") Long productId, @RequestParam("skuId") Long skuId);
}
